package com.mzpai.board.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mzpai.board.mapper.OperateLogMapper;
import com.mzpai.board.model.OperateLog;
import com.mzpai.board.service.OperateLogService;
import com.mzpai.board.vo.OperateLogReqVo;
import com.mzpai.service.impl.BaseServiceImpl;

@Service
public class OperateLogServiceImpl extends BaseServiceImpl<OperateLog> implements OperateLogService {
	
	
	@Autowired
	private OperateLogMapper  mapper;
	
	protected Logger logger = LoggerFactory.getLogger(OperateLogServiceImpl.class);

	
	/**
	 * 统计当天，按kindCode分组
	 * @param toDay
	 * @return
	 */
	@Override
	public List<OperateLog> getListByDate(Map<String, Object> map) {
		return mapper.getListByDate(map);
	}


	/**
	 * 统计hour，按kindCode分组
	 * @param toDay
	 * @return
	 */
	@Override
	public List<OperateLog> getListByHour(Map<String, Object> map) {
		return mapper.getListByHour(map);
	}


	@Override
	public List<OperateLog> getFirstStoreDetailList(OperateLogReqVo reqVo) {
		String beginDateStr=reqVo.getBeginDate();
		String endDateStr=reqVo.getEndDate();
		String kindCode=reqVo.getKindCode();
		List<String> storeIdNotInList=reqVo.getStoreIdNotInList();
		Map<String, Object> map=new HashMap<String,Object>();
		map.put("beginDate", beginDateStr);
		map.put("endDate", endDateStr);
		map.put("kindCode", kindCode);
		map.put("storeIdNotInList", storeIdNotInList);
		List<OperateLog> list=mapper.getFirstStoreDetailList(map);
		return list;
	}

}
